package com.ruoyi.system.service.impl;

import java.util.Arrays;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.BaseReportDayMapper;
import com.ruoyi.system.domain.BaseReportDay;
import com.ruoyi.system.service.IBaseReportDayService;

import javax.annotation.Resource;

/**
 * 报每日在线人数和每日注册用户Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-03-13
 */
@Service
public class BaseReportDayServiceImpl implements IBaseReportDayService 
{
    @Resource
    private BaseReportDayMapper baseReportDayMapper;

    /**
     * 查询报每日在线人数和每日注册用户
     * 
     * @param id 报每日在线人数和每日注册用户主键
     * @return 报每日在线人数和每日注册用户
     */
    @Override
    public BaseReportDay selectBaseReportDayById(Long id)
    {
        return baseReportDayMapper.selectBaseReportDayById(id);
    }

    /**
     * 查询报每日在线人数和每日注册用户列表
     * 
     * @param baseReportDay 报每日在线人数和每日注册用户
     * @return 报每日在线人数和每日注册用户
     */
    @Override
    public List<BaseReportDay> selectBaseReportDayList(BaseReportDay baseReportDay)
    {
        return baseReportDayMapper.selectBaseReportDayList(baseReportDay);
    }

    /**
     * 新增报每日在线人数和每日注册用户
     * 
     * @param baseReportDay 报每日在线人数和每日注册用户
     * @return 结果
     */
    @Override
    public int insertBaseReportDay(BaseReportDay baseReportDay)
    {
        baseReportDay.setCreateTime(DateUtils.getNowDate());
        return baseReportDayMapper.insertBaseReportDay(baseReportDay);
    }

    /**
     * 修改报每日在线人数和每日注册用户
     * 
     * @param baseReportDay 报每日在线人数和每日注册用户
     * @return 结果
     */
    @Override
    public int updateBaseReportDay(BaseReportDay baseReportDay)
    {
        baseReportDay.setUpdateTime(DateUtils.getNowDate());
        return baseReportDayMapper.updateBaseReportDay(baseReportDay);
    }

    /**
     * 批量删除报每日在线人数和每日注册用户
     * 
     * @param ids 需要删除的报每日在线人数和每日注册用户主键
     * @return 结果
     */
    @Override
    public int deleteBaseReportDayByIds(Long[] ids)
    {
        return baseReportDayMapper.deleteBaseReportDayByIds(ids);
    }

    /**
     * 删除报每日在线人数和每日注册用户信息
     * 
     * @param id 报每日在线人数和每日注册用户主键
     * @return 结果
     */
    @Override
    public int deleteBaseReportDayById(Long id)
    {
        return baseReportDayMapper.deleteBaseReportDayById(id);
    }

    @Override
    public List<BaseReportDay> dailyOnlineNumber(BaseReportDay baseReportDay) {
        return baseReportDayMapper.dailyOnlineNumber(baseReportDay);
    }

    @Override
    public List<BaseReportDay> dailyRegistrations(BaseReportDay baseReportDay) {
        return baseReportDayMapper.dailyRegistrations(baseReportDay);
    }

    /**
     * 首页折线图数据
     *
     * @param
     * @return 结果
     */
    @Override
    public List<BaseReportDay> indexChartData(Long[]  types) {

        return  baseReportDayMapper.indexChartData(types);
    }
}
